﻿using JmShared;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Text;

namespace JiveMessenger.Models
{
    public class VisualNotification : INotifyPropertyChanged
    {
        private NotificationType _notificationType;
        public NotificationType Notificationtype
        {
            get { return _notificationType; }
            set
            {
                if (_notificationType != value)
                {
                    _notificationType = value;
                    RaisePropertyChanged("Notificationtype");
                }
            }
        }

        private ObservableCollection<NotificationBase> _notifications;
        public ObservableCollection<NotificationBase> Notifications
        {
            get { return _notifications; }
            set
            {
                if (_notifications != value)
                {
                    _notifications = value;
                    RaisePropertyChanged("Notifications");
                }
            }
        }


        public VisualNotification() { }
        public VisualNotification(NotificationType type, ObservableCollection<NotificationBase> notifications)
        {
            this.Notificationtype = type;
            this.Notifications = new ObservableCollection<NotificationBase>(notifications);

        }
        protected void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
        public event PropertyChangedEventHandler PropertyChanged;

    }
}
